# coding:utf-8
# *******************************************************************
# * Copyright 2021-2080 evilbinary
# * 作者: evilbinary on 01/01/20
# * 邮箱: rootdebug@163.com
# ********************************************************************
import os

Import('env')               


# with open('env_dump.txt', 'w') as file:
#     env_dumped = env.Dump()
#     for key in env_dumped:
#         file.write(key)

env.GenerateKernelSize('config.h',['../../app/kernel'])

env.Object('boot', ['boot.s'],ASFLAGS='')

env.Program(target ='init.elf', source = [
    'boot.o',
    'init.c',
    # 'test.o',
    # 'kernel.c',

    ],
    CFLAGS='$CFLAGS -I. -Iinclude',
    LINKFLAGS= '-nostdlib -nostartfiles -T boot/arm/link.ld')

env.Objcopy('init.bin','init.elf',OBJCOPYFLAGS='-O binary -S --strip-debug')